We catch SIGBUS and SIGSEGV so the terminal can be reset.
But that means we don't see a core dump if there should be one.
So for those signals, clear the signal handler after reseting
the terminal, and return. Then the core will be dumped.
Reported-by: Paul Wise <pabs3@bonedaddy.net>
nl();
endwin();
printf("Died on signal %d\n", sig);
- exit(2);
+ fflush(stdout);
+ if (sig != SIGBUS && sig != SIGSEGV)
+ exit(2);
+ else
+ /* Otherwise return and die */
+ signal(sig, NULL);
}
static void term_init(void)